<template>
	<view>
		<button @click="open">获取头像昵称</button>
		<nx-userinfo v-if="show" :data="userinfo" @confirm="handleConfirm" @cancel="handleCancel"></nx-userinfo>
	</view>
</template>

<script setup>
	import {
		onMounted,
		ref
	} from "vue";

	const userinfo = ref({
		nickname: '',
		avatarUrl: ''
	})

	const show = ref(false)
	const open = () => {
		show.value = true
	}

	const handleConfirm = (data) => {
		console.log(data);
		show.value = false
	}
	const handleCancel = () => {
		show.value = false
	}
</script>

<style>

</style>